var previous_id = 0;
var request_send = false;

function display_inquiry_box_extended(image_path, id, sb_uid, sb_id, sb_keywords, sb_catid, offer_type, sb_title, div_new_id, new_view)
{
	if (request_send == true)
		return false;

	set_cookie('c_redirect_url', encodeURI(location.href));

	request_send = true;
	if (div_new_id){
		var div_id = 'div_inquiry_new_' + id;
	} 
	else {
	var div_id = 'div_inquiry_' + id;
	}

	jQuery('#' + div_id ).html('<img id="bc_imgLoading" src="'+ image_path +'" > Loading, Please wait..');

	inquiry_data = "sb_id=" + sb_id +
				   "&sb_uid=" + sb_uid +
				   "&sb_keywords=" + sb_keywords +
				   "&sb_catid=" + sb_catid +
				   "&offer_type=" + offer_type +
				   "&sb_title=" + sb_title;

	if (new_view!=null && new_view == 1){
		var url_post="/index.php?action=widgets_inquirywidget&view=2";
	}else { 
		var url_post="/index.php?action=widgets_inquirywidget";
	}

	jQuery.ajax(
	{
		type: "POST",
		url: url_post,
		data: inquiry_data,
		dataType: "html",
		success: function(result)
		{
			if (previous_id > 0)
				jQuery('#div_inquiry_' + previous_id).html('');

			previous_id = id;
			jQuery('#' + div_id).html(result)
								.append('<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/956087085/?label=d7NICMuWrwMQrfbyxwM&guid=ON&script=0" />');
			request_send = false;
		}
	});
}